/**
 * 客片页面相关API
 */
import request from "@/utils/request";
import env from "@/utils/env";
import { getItem } from "@/utils/localStorage";

// 获取客片（已登录）
export const getGuestFilm = (
  pageNo = 1,
  pageSize = 10,
  shopId = 2,
  clientId
) => {
  return request({
    url: `/cloth/guest/image/getGuestImagePage?pageNo=${pageNo}&pageSize=${pageSize}&shopId=${shopId}&clientId=${clientId}`,
    method: "GET",
  });
};

// 获取客片（未登录）
export const getGuestFilmNotId = (pageNo = 1, pageSize = 10, shopId = 2) => {
  return request({
    url: `/cloth/guest/image/getGuestImagePage?pageNo=${pageNo}&pageSize=${pageSize}&shopId=${shopId}`,
    method: "GET",
  });
};

// 点赞客片
export const giveLove = (guestFilmId, userId) => {
  return request({
    url: `/cloth/guest/image-like/isLiked/${guestFilmId}/${userId}`,
    method: "GET",
  });
};

// 获取客片详情
export const guestFilmDetails = (guestFilmId, clientId) => {
  return request({
    // url: `/cloth/guest/image-info/detail?guestImageId=${guestFilmId}&clientId=${clientId}`,
    url: `/cloth/guest/image-info/detail?guestImageId=${guestFilmId}`,
    method: "GET",
  });
};

// 查看订单（为你推荐）
export const recommendForYou = (shopId = 1, isRecommend = 0) => {
  return request({
    url: `/cloth/guest/image/getAllGuestImages?shopId=${shopId}&isRecommend=${isRecommend}`,
    method: "GET",
  });
};

// 客片视频
export const guestFilmVideo = (pageNo, pageSize) => {
  return request({
    url: `/cloth/video/getAll?pageNo=${pageNo}&pageSize=${pageSize}`,
    method: "GET",
  });
};
